#include <bits/stdc++.h>
#include <regex>
#include "testlib.h"

using namespace std;

int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int group = atoi(validator.group().c_str());
    if (group == 0) group = 1;
    ensure (group == 1 || group == 2 || group == 3);
    int max_val = 9;
    if (group == 2) max_val = 20000;
    if (group == 3) max_val = 1000000000;
    
    int t = inf.readInt(1, 10, "t");
    inf.readEoln();
    for(; t > 0; --t) {
        inf.readInt(1, max_val, "n");
        inf.readEoln();
        inf.readInt(1, max_val, "a");
        inf.readEoln();
        inf.readInt(1, max_val, "b");
        inf.readEoln();
    }
    inf.readEof();
}
